package org.geektimes.projects.user.web.controller;

import org.eclipse.microprofile.config.Config;
import org.geektimes.web.mvc.controller.PageController;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.POST;
import javax.ws.rs.Path;

/**
 * @ClassName: ConfigController
 * @Description:
 * @Author: Hades
 * @created: 2021/03/25 00:08
 * @Version:1.0
 */
@Path("/config")
public class ConfigController implements PageController {

    @Override
    @POST
    public String execute(HttpServletRequest request, HttpServletResponse response) throws Throwable {
        ServletContext servletContext = request.getServletContext();
        Config config = (Config)servletContext.getAttribute("config");
        System.out.println(config.getPropertyNames());
        return "index.jsp";
    }
}
